package com.study.java.jinjie.jihe.lianxi.si;

public class Student {
    private long num;
    private  String name;
    private int chengJi;

    public Student(long num, String name, int chengJi) {
        this.num = num;
        this.name = name;
        this.chengJi=setChengJi(chengJi);

    }

    public long getNum() {
        return num;
    }

    public void setNum(long num) {
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getChengJi() {
        return chengJi;
    }

    public int  setChengJi(int chengJi) {
       if (chengJi < 100){
            this.chengJi = chengJi;
       }else {
           this.chengJi = 100;
           System.out.println("无效成绩!");
       }
       return chengJi;
    }
}
